import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueDevTools from "vite-plugin-vue-devtools";

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    vueDevTools(),
    // 如果你使用 vite-plugin-less，请确保已经安装并启用
    // less()
  ],
  css: {
    preprocessorOptions: {
      less: {
        charset: false,
        additionalData: `@import "@/styles/variables.less";`,
      },
    },
  },
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});
